<?php
@header("Content-Type:text/html;charset=iso-8859-1");

error_reporting(E_ERROR | E_WARNING | E_PARSE);
//error_reporting(E_ALL);
set_magic_quotes_runtime(0);
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];

define('IN_WEBSHOP', TRUE);
define('WEBSHOP_ROOT', substr(dirname(__FILE__), 0, -7));

if(PHP_VERSION < '4.1.0') {
    $_GET = &$HTTP_GET_VARS;
    $_POST = &$HTTP_POST_VARS;
    $_COOKIE = &$HTTP_COOKIE_VARS;
    $_SERVER = &$HTTP_SERVER_VARS;
    //$_ENV = &$HTTP_ENV_VARS;
    $_FILES = &$HTTP_POST_FILES;
}
unset($_ENV,$HTTP_ENV_VARS,$_REQUEST,$HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_POST_FILES,$HTTP_COOKIE_VARS,$HTTP_SERVER_VARS);

require_once WEBSHOP_ROOT.'./include/global.function.php';

// תȫֱ
$magic_quotes_gpc = get_magic_quotes_gpc();
@daddslashes($_COOKIE);
@daddslashes($_POST);
@daddslashes($_GET);
if(!$magic_quotes_gpc) {
	$_FILES = daddslashes($_FILES);
}

require_once WEBSHOP_ROOT.'./config.inc.php';
require_once WEBSHOP_ROOT.'./include/db_'.$database.'.class.php';
require_once WEBSHOP_ROOT.'./include/mysql.php';

$timestamp = time();
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];

if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
    $onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
    $onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
    $onlineip = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
    $onlineip = $_SERVER['REMOTE_ADDR'];
}
$onlineip = preg_replace("/^([\d\.]+).*/", "\\1", $onlineip);

$cart_url="shopping_cart.php";
if($promoter_uid!="")
{ $cart_url="shopping_cart_p.php"; }

$PAYMENT_METHOD_ARY = array(1=>'Credit Card', 2=>'Cheque', 3=>'Bank Draft', 4=>'TT Transfer');
$CARD_TYPE_ARY = array(1=>'Visa', 2=>'Master', 3=>'American Express', 4=>'Others');

$MENU_ARY = array(
1 => array('width'=>'63', 'name'=>'Home', 'href'=>'index.php'),
2 => array('width'=>'61', 'name'=>'News', 'href'=>'news.php'),
3 => array('width'=>'82', 'name'=>'Contact us', 'href'=>'contact_us.php'),
4 => array('width'=>'147', 'name'=>'Customer Services', 'href'=>'customer_service.php'),
5 => array('width'=>'51', 'name'=>'FAQ', 'href'=>'faq.php'),
6 => array('width'=>'119', 'name'=>'Delivery Policy', 'href'=>'delivery_policy.php'),
7 => array('width'=>'78', 'name'=>'Sitemap', 'href'=>'sitemap.php'),
8 => array('width'=>'124', 'name'=>'Promoter Login', 'href'=>'promoter_login.php'),
);

$COURSE_ARY = array(
1 => 'Evening Seminars',
2 => 'Training Courses',
3 => 'Training Programs',
4 => 'In-house Training',
);

$COUNTRY_ARY = array(
0 => 'Danmark',
1 => 'Europe',
2 => 'Others',
3 => 'Pick up',
);

$EMONTH_ARY = array(
'01' => '01',
'02' => '02',
'03' => '03',
'04' => '04',
'05' => '05',
'06' => '06',
'07' => '07',
'08' => '08',
'09' => '09',
'10' => '10',
'11' => '11',
'12' => '12'
);

$EYEAR_ARY = array(
'07' => '2007',
'08' => '2008',
'09' => '2009',
'10' => '2010',
'11' => '2011',
'12' => '2012',
'13' => '2013',
'14' => '2014',
'15' => '2015',
'16' => '2016',
'17' => '2017',
'18' => '2018',
'19' => '2019',
'20' => '2020',
'21' => '2021',
'22' => '2022',
);

$PROMOTER_MENU_ARY = array(
1 => array('name'=>'Summary', 'href'=>'promoter_summary.php'),
2 => array('name'=>'Personal Information', 'href'=>'promoter_info_preview.php'),
3 => array('name'=>'Sales Transactions', 'href'=>'promoter_sales.php'),
4 => array('name'=>'Commission Paid', 'href'=>'promoter_commission.php'),
5 => array('name'=>'Promotion banner', 'href'=>'promoter_promotionBanner.php'),
6 => array('name'=>'Logout', 'href'=>'promoter_logout.php'),
);

$RANK_ARY = array(
1 => 'Silver',
2 => 'Gold',
3 => 'Platinum',
);

$CARD_TYPE_ARY = array(
'V-DK' => 'Visa',
'MC(DK)' => 'MasterCard',
'DK' => 'Dankort or Visa/Dankort',
);

$db = new DB($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
$mysql=new mysql($dbhost,$dbuser,$dbpw ,$dbname);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);

$webmaster_name = 'daisyy';
$webmaster_email = 'daisyy@acuityworld.com';

// ̨ҳļ
if (eregi("/admin/", $_SERVER['REQUEST_URI']) || eregi("/admin/", $_SERVER['SCRIPT_NAME'])) {
    require_once WEBSHOP_ROOT.'./include/common.admin.inc.php';
}
?>